package ru.papergames.model.binsocket.packets.response
{
	import flash.geom.Rectangle;
	
	import ru.papergames.model.binsocket.data.ExtByteArray;
	import ru.papergames.model.binsocket.packets.SocketResponse;

	public class BattleMapInfoResponse extends SocketResponse
	{		
		public static const NOTIFICATION:String = 'BattleMapInfoResponse';
		
		public var battleOrderId:uint;
		public var mapSize:Rectangle;		
		public var obstacles:Array;
		
		public function BattleMapInfoResponse(bytes:ExtByteArray)
		{
			super(bytes);
		}
		
		override protected function decode():void {
			
			battleOrderId = binaryData.readUnsignedInt();
			
			mapSize = new Rectangle(0, 0, 
									binaryData.readUnsignedShort(), 
									binaryData.readUnsignedShort());
			
			obstacles = [];
		}
		
		override public function getNotification():String {
			return NOTIFICATION;
		}
	}
}